package com.life.days;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import java.util.Calendar;
import java.util.Date;

public class LifeBySecondsActivity extends Activity implements View.OnClickListener  {
    /** Called when the activity is first created. */
	
	
	
	int yearnow = 2012;
	int monthnow = 6;
	int daynow = 26;
	
	
	String age=yearnow+"\r"+monthnow+"\r"+daynow;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Spinner year = (Spinner) findViewById(R.id.Year);
        ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.Years, android.R.layout.simple_spinner_item);
        year.setAdapter(adapter);
        
        Spinner month = (Spinner) findViewById(R.id.Month);
        ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.Months, android.R.layout.simple_spinner_item);
        month.setAdapter(adapter1);
        
        Spinner day = (Spinner) findViewById(R.id.Day);
        ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this, R.array.Days, android.R.layout.simple_spinner_item);
        day.setAdapter(adapter2);
        
        Button count = (Button) findViewById(R.id.count);
        count.setOnClickListener(this);
        
        
        
    }

    public void onClick(View v) {
    	 Spinner year = (Spinner) findViewById(R.id.Year);
         ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.Years, android.R.layout.simple_spinner_item);
         year.setAdapter(adapter);
         
         Spinner month = (Spinner) findViewById(R.id.Month);
         ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.Months, android.R.layout.simple_spinner_item);
         month.setAdapter(adapter1);
         
         Spinner day = (Spinner) findViewById(R.id.Day);
         ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this, R.array.Days, android.R.layout.simple_spinner_item);
         day.setAdapter(adapter2);
         
         
         
         
         
         Toast toast = Toast.makeText(getApplicationContext(), age, Toast.LENGTH_LONG);
    	
    	
    	
    	
    }
}